﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdDbBaseDatabasePE : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbBaseDatabasePE(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdDbBaseDatabasePE_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbBaseDatabasePE obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbBaseDatabasePE()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdDbBaseDatabasePE(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbBaseDatabasePE cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_cast(OdRxObject.getCPtr(pObj));
			OdDbBaseDatabasePE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdDbBaseDatabasePE createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_createObject();
			OdDbBaseDatabasePE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBaseDatabasePE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbBaseHostAppServices appServices(OdRxObject pDb)
		{
			OdDbBaseHostAppServices result = (OdDbBaseHostAppServices)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_appServices(this.swigCPtr, OdRxObject.getCPtr(pDb)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getFilename(OdRxObject pDb)
		{
			string result = GlobalsPINVOKE.OdDbBaseDatabasePE_getFilename(this.swigCPtr, OdRxObject.getCPtr(pDb));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void startTransaction(OdRxObject pDb)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_startTransaction(this.swigCPtr, OdRxObject.getCPtr(pDb));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void abortTransaction(OdRxObject pDb)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_abortTransaction(this.swigCPtr, OdRxObject.getCPtr(pDb));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiDefaultContext createGiContext(OdRxObject pDb)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_createGiContext(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdGiDefaultContext result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiDefaultContext)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiDefaultContext)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiDefaultContext)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void putNamedViewInfo(OdRxObject pDb, OdDbStub layoutId, OdStringArray names, OdGePoint3dArray points)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_putNamedViewInfo(this.swigCPtr, OdRxObject.getCPtr(pDb), OdDbStub.getCPtr(layoutId), OdStringArray.getCPtr(names), OdGePoint3dArray.getCPtr(points));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdBaseTextIterator createTextIterator(OdRxObject db, string textString, int length, bool raw, OdGiTextStyle pTextStyle)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_createTextIterator(this.swigCPtr, OdRxObject.getCPtr(db), textString, length, raw, OdGiTextStyle.getCPtr(pTextStyle));
			OdBaseTextIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdBaseTextIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdBaseTextIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdBaseTextIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsDevice setupActiveLayoutViews(OdGsDevice pDevice, OdGiDefaultContext pGiCtx)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_setupActiveLayoutViews(this.swigCPtr, OdGsDevice.getCPtr(pDevice), OdGiDefaultContext.getCPtr(pGiCtx));
			OdGsDevice result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsDevice setupLayoutView(OdGsDevice pDevice, OdGiDefaultContext pGiCtx, OdDbStub layoutId)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_setupLayoutView(this.swigCPtr, OdGsDevice.getCPtr(pDevice), OdGiDefaultContext.getCPtr(pGiCtx), OdDbStub.getCPtr(layoutId));
			OdGsDevice result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGsDevice)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setupPalette(OdGsDevice device, OdGiDefaultContext giContext, OdDbStub layoutId, uint palBg)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_setupPalette__SWIG_0(this.swigCPtr, OdGsDevice.getCPtr(device), OdGiDefaultContext.getCPtr(giContext), OdDbStub.getCPtr(layoutId), palBg);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setupPalette(OdGsDevice device, OdGiDefaultContext giContext, OdDbStub layoutId)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_setupPalette__SWIG_1(this.swigCPtr, OdGsDevice.getCPtr(device), OdGiDefaultContext.getCPtr(giContext), OdDbStub.getCPtr(layoutId));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setupPalette(OdGsDevice device, OdGiDefaultContext giContext)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_setupPalette__SWIG_2(this.swigCPtr, OdGsDevice.getCPtr(device), OdGiDefaultContext.getCPtr(giContext));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbStub getNextViewForActiveLayout(OdGiDefaultContext pGiCtx, OdDbStub arg1)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getNextViewForActiveLayout(this.swigCPtr, OdGiDefaultContext.getCPtr(pGiCtx), OdDbStub.getCPtr(arg1));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void applyLayoutSettings(OdGsDCRect clipBox, OdGsDevice pDevice, OdRxObject db)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_applyLayoutSettings(this.swigCPtr, OdGsDCRect.getCPtr(clipBox), OdGsDevice.getCPtr(pDevice), OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoomToExtents(OdGsDCRect outputRect, OdGsDevice pDevice, OdRxObject db, bool exactExtents, OdDbStub objectId)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_zoomToExtents__SWIG_0(this.swigCPtr, OdGsDCRect.getCPtr(outputRect), OdGsDevice.getCPtr(pDevice), OdRxObject.getCPtr(db), exactExtents, OdDbStub.getCPtr(objectId));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoomToExtents(OdGsDCRect outputRect, OdGsDevice pDevice, OdRxObject db, bool exactExtents)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_zoomToExtents__SWIG_1(this.swigCPtr, OdGsDCRect.getCPtr(outputRect), OdGsDevice.getCPtr(pDevice), OdRxObject.getCPtr(db), exactExtents);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void zoomToExtents(OdGsDCRect outputRect, OdGsDevice pDevice, OdRxObject db)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_zoomToExtents__SWIG_2(this.swigCPtr, OdGsDCRect.getCPtr(outputRect), OdGsDevice.getCPtr(pDevice), OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void loadPlotstyleTableForActiveLayout(OdGiDefaultContext pDwgContext, OdRxObject db)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_loadPlotstyleTableForActiveLayout(this.swigCPtr, OdGiDefaultContext.getCPtr(pDwgContext), OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdRxIterator layers(OdRxObject db)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_layers(this.swigCPtr, OdRxObject.getCPtr(db));
			OdRxIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject currentLayout(OdRxObject db)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_currentLayout(this.swigCPtr, OdRxObject.getCPtr(db));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setCurrentLayout(OdRxObject db, string name)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_setCurrentLayout(this.swigCPtr, OdRxObject.getCPtr(db), name);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdRxIterator layouts(OdRxObject db)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_layouts(this.swigCPtr, OdRxObject.getCPtr(db));
			OdRxIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdRxIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject getLayout(OdRxObject db, string name)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_getLayout(this.swigCPtr, OdRxObject.getCPtr(db), name);
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject findLayoutByViewport(OdRxObject db, OdDbStub pViewportId)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_findLayoutByViewport(this.swigCPtr, OdRxObject.getCPtr(db), OdDbStub.getCPtr(pViewportId));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub findLayoutNamed(OdRxObject db, string name)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_findLayoutNamed(this.swigCPtr, OdRxObject.getCPtr(db), name);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject getFirstLayout(OdRxObject db)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_getFirstLayout(this.swigCPtr, OdRxObject.getCPtr(db));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdTimeStamp getCreationTime(OdRxObject db)
		{
			OdTimeStamp result = new OdTimeStamp(GlobalsPINVOKE.OdDbBaseDatabasePE_getCreationTime(this.swigCPtr, OdRxObject.getCPtr(db)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdTimeStamp getUpdateTime(OdRxObject db)
		{
			OdTimeStamp result = new OdTimeStamp(GlobalsPINVOKE.OdDbBaseDatabasePE_getUpdateTime(this.swigCPtr, OdRxObject.getCPtr(db)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getFingerPrintGuid(OdRxObject db)
		{
			string result = GlobalsPINVOKE.OdDbBaseDatabasePE_getFingerPrintGuid(this.swigCPtr, OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getVersionGuid(OdRxObject db)
		{
			string result = GlobalsPINVOKE.OdDbBaseDatabasePE_getVersionGuid(this.swigCPtr, OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual int getUnits(OdRxObject db)
		{
			int result = GlobalsPINVOKE.OdDbBaseDatabasePE_getUnits(this.swigCPtr, OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdUnitsFormatter baseFormatter(OdRxObject db)
		{
			OdUnitsFormatter result = (OdUnitsFormatter)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_baseFormatter(this.swigCPtr, OdRxObject.getCPtr(db)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual int getMeasurement(OdRxObject db)
		{
			int result = GlobalsPINVOKE.OdDbBaseDatabasePE_getMeasurement(this.swigCPtr, OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool getLineTypeById(OdRxObject db, OdDbStub pLTypeId, OdGiLinetype LType)
		{
			bool result = GlobalsPINVOKE.OdDbBaseDatabasePE_getLineTypeById(this.swigCPtr, OdRxObject.getCPtr(db), OdDbStub.getCPtr(pLTypeId), OdGiLinetype.getCPtr(LType));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool getTextStyleById(OdRxObject db, OdDbStub idStyle, OdGiTextStyle shapeInfo)
		{
			bool result = GlobalsPINVOKE.OdDbBaseDatabasePE_getTextStyleById(this.swigCPtr, OdRxObject.getCPtr(db), OdDbStub.getCPtr(idStyle), OdGiTextStyle.getCPtr(shapeInfo));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject createObjectById(OdDbStub Id)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_createObjectById(this.swigCPtr, OdDbStub.getCPtr(Id));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getObject(OdRxObject db, ulong handle)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getObject(this.swigCPtr, OdRxObject.getCPtr(db), handle);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHandle getHandle(OdDbStub id)
		{
			OdDbHandle result = new OdDbHandle(GlobalsPINVOKE.OdDbBaseDatabasePE_getHandle(this.swigCPtr, OdDbStub.getCPtr(id)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject getDatabase(OdDbStub id)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseDatabasePE_getDatabase(this.swigCPtr, OdDbStub.getCPtr(id)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getOwner(OdDbStub id)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getOwner(this.swigCPtr, OdDbStub.getCPtr(id));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdCodePageId getCodePage(OdRxObject db)
		{
			OdCodePageId result = (OdCodePageId)GlobalsPINVOKE.OdDbBaseDatabasePE_getCodePage(this.swigCPtr, OdRxObject.getCPtr(db));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getModelBlockId(OdRxObject pDb)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getModelBlockId(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getPaperBlockId(OdRxObject pDb)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getPaperBlockId(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub currentLayoutId(OdRxObject pDb)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_currentLayoutId(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub xrefBlockId(OdRxObject pDb)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_xrefBlockId(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setMultiThreadedRender(OdRxObject pDb, bool bOn)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_setMultiThreadedRender(this.swigCPtr, OdRxObject.getCPtr(pDb), bOn);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isAProxy(OdRxObject pDrw)
		{
			bool result = GlobalsPINVOKE.OdDbBaseDatabasePE_isAProxy(this.swigCPtr, OdRxObject.getCPtr(pDrw));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject openObject(OdDbStub pId)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_openObject(this.swigCPtr, OdDbStub.getCPtr(pId));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool getAnnoScaleSet(OdDbStub drawableId, SWIGTYPE_p_OdGiAnnoScaleSet res)
		{
			bool result = GlobalsPINVOKE.OdDbBaseDatabasePE_getAnnoScaleSet(this.swigCPtr, OdDbStub.getCPtr(drawableId), SWIGTYPE_p_OdGiAnnoScaleSet.getCPtr(res));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getCurrentLongTransation(OdRxObject pDb)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseDatabasePE_getCurrentLongTransation(this.swigCPtr, OdRxObject.getCPtr(pDb));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdRxObject addDatabaseUnloadReactor(OdRxObject pDb, OdRxObject pPrevReactor, OdDbBaseDatabasePE.DatabaseUnloadReactor pReactorRedirect)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseDatabasePE_addDatabaseUnloadReactor(this.swigCPtr, OdRxObject.getCPtr(pDb), OdRxObject.getCPtr(pPrevReactor), OdDbBaseDatabasePE.DatabaseUnloadReactor.getCPtr(pReactorRedirect));
			OdRxObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void removeDatabaseUnloadReactor(OdRxObject pDb, OdRxObject pReactor)
		{
			GlobalsPINVOKE.OdDbBaseDatabasePE_removeDatabaseUnloadReactor(this.swigCPtr, OdRxObject.getCPtr(pDb), OdRxObject.getCPtr(pReactor));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public class DatabaseUnloadReactor : IDisposable
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public DatabaseUnloadReactor(IntPtr cPtr, bool cMemoryOwn)
			{
				this.swigCMemOwn = cMemoryOwn;
				this.swigCPtr = new HandleRef(this, cPtr);
			}

			[EditorBrowsable(EditorBrowsableState.Never)]
			public static HandleRef getCPtr(OdDbBaseDatabasePE.DatabaseUnloadReactor obj)
			{
				if (obj != null)
				{
					return obj.swigCPtr;
				}
				return new HandleRef(null, IntPtr.Zero);
			}

			~DatabaseUnloadReactor()
			{
				this.Dispose();
			}

			public virtual void Dispose()
			{
				if (this.swigCPtr.Handle != IntPtr.Zero)
				{
					if (this.swigCMemOwn)
					{
						lock (this.locker)
						{
							if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
							{
								this.swigCMemOwn = false;
								GlobalsPINVOKE.delete_OdDbBaseDatabasePE_DatabaseUnloadReactor(this.swigCPtr);
							}
						}
						this.swigCMemOwn = false;
					}
					this.swigCPtr = new HandleRef(null, IntPtr.Zero);
				}
				GC.SuppressFinalize(this);
			}

			public virtual void goodbye(OdRxObject pDb)
			{
				GlobalsPINVOKE.OdDbBaseDatabasePE_DatabaseUnloadReactor_goodbye(this.swigCPtr, OdRxObject.getCPtr(pDb));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}

			private object locker = new object();

			private HandleRef swigCPtr;

			protected bool swigCMemOwn;
		}
	}
}
